<template>
  <div>
    <div class="al-flex-wrap">
      <div v-for="(item, index) in typeData"

           @click="sendData(item.name)"
           :key="index" class="al-m-10px al-cursor-pointer al-hover-color-blue al-flex-container-center-v">
        <div :class="activeType == item.name ? 'al-border-capsule al-gradient-to-top-light-blue al-text-color-white ':''"
             class="al-flex-container-center-h" style="width: 100px">
          {{item.name}}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "TypeSelectorComponent",
    //组件
    components: {},
    //属性
    props: {
      typeData:{
        type: Array,
        default: undefined
      },
      defaultActiveType:{
        type: String,
        default: '全部'
      }
    },

    //数据
    data() {
      return {
        activeType: this.$props.defaultActiveType,
      }
    },

    //挂载完成时
    mounted() {

    },

    //方法
    methods: {
      sendData(name){
        this.activeType = name;
        this.$emit("getSonData", name);
      }
    },

    //计算属性
    computed: {},

    //监听
    watch: {}
  }
</script>

<style scoped>

</style>
